package model

import "log"

type Borrow struct {
	BorrowId   string
	BorrowItem []*BorrowItem
	UserId     int64
	TotalNums  int64
	//BorrowTime string
	//ReturnTime string
	Username string
	IsLogin  bool
}

func (b *Borrow) GetTotalNums() int64 {
	var totalNums int64
	for _, v := range b.BorrowItem {
		totalNums += v.BorrowNums
	}
	log.Println("GetTotalNums()函数里的b.BorrowItem", b.BorrowItem)
	log.Println("GetTotalNums()函数里的totalNums", totalNums)
	return totalNums
}
